﻿
@{
    ViewData["Title"] = "商铺管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model EasyToHelp.Entity.ShopLeaseInfo
<link href="/Uploader/Uploader6.1.css" rel="stylesheet" />
<script src="/Uploader/Uploader6.1.js"></script>
<script src="/js/ShopManage.js"></script>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">商铺管理</h1>
</header>
<div class="mui-content">
    <input type="hidden" id="Id" name="Id" value="@(Model == null?0:Model.Id)" />
    <div class="mui-content-padded" style="margin: 5px;">
        <div class="mui-content-padded">
            <h5>选择市场</h5>
            <select id="MarketId" class="mui-btn mui-btn-block">
                <option value="0">请选择市场</option>
                @foreach (var item in ViewBag.Market)
                {
                    @if (Model != null)
                    {
                        if (Model.MarketId == item.Id)
                        {
                            <option value="@item.Id" selected>@item.MarketName</option>
                        }
                    }
                    <option value="@item.Id">@item.MarketName</option>
                }
            </select>
            <h5>经营主体</h5>
            <select id="GId" name="GId" class="mui-btn mui-btn-block">
                <option value="0">请选择经营主体</option>
                @foreach (var item in ViewBag.GoodsClass)
                {
                    @if (Model != null)
                    {
                        if (Model.GId == item.Id)
                        {
                            <option value="@item.Id" selected>@item.ClassName</option>
                        }
                    }
                    <option value="@item.Id">@item.ClassName</option>
                }
            </select>
            <h5>店铺名称</h5>
            <div class="mui-input-row">
                <input id="ShopName" name="ShopName" type="text" placeholder="店铺名称" value="@(Model == null?"":Model.ShopName)">
            </div>
            <h5>店招</h5>
            <div class="mui-input-row">
                <div class="uploader uploader-default" id="uploadShopLogo">
                </div>
            </div>
            <h5>店招预览</h5>
            <div class="mui-input-row">
                @if (Model == null)
                {
                    <img id="PreviewShopLogo" src='/images/zanwu.jpg' height="150" width="100%">
                }
                else
                {
                    <img id="PreviewShopLogo" src="@(Model == null?"":Model.ShopLogo)" height="150" width="100%">
                }
            </div>
            <h5>店铺二维码</h5>
            <div class="mui-input-row">
                <div class="uploader uploader-default" id="uploadShopQRCode">
                </div>
            </div>
            <h5>二维码预览</h5>
            <div class="mui-input-row">
                @if (Model == null)
                {
                    <img id="PreviewShopQRCode" src='/images/zanwu.jpg' height="150" width="100%">
                }
                else
                {
                    <img id="PreviewShopQRCode" src="@(Model == null?"":Model.ShopLogo)" height="150" width="100%">
                }
            </div>
            <h5>商铺地址</h5>
            <div class="mui-input-row">
                <textarea id="ShopAddress" name="ShopAddress" rows="3" placeholder="商铺详细地址">@(Model == null ? "" : Model.ShopAddress)</textarea>
            </div>
            <h5>商铺介绍</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <textarea id="Description" name="Description" rows="8" placeholder="商铺介绍">@Html.Raw(Model == null ? "" : Model.Description)</textarea>
            </div>
            <div class="mui-button-row">
                <button type="button" class="mui-btn mui-btn-primary" onclick="SubShopInfo()">确认</button>&nbsp;&nbsp;
                <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
            </div>
        </div>
    </div>
</div>

